﻿using System;
using System.Collections.Generic;
using System.IO;

namespace SFMLPlatformerEngine {

	sealed class GameObjectDictionary : Dictionary<char, GameObject> {

		public GameObjectDictionary() {

			string[] conf = File.ReadAllLines("res/mapKeys.dat");
			foreach(string s in conf) {
				if(s.StartsWith("/*") | String.IsNullOrEmpty(s))
					continue;

				GameObject o = GameObject.FromString(s);
				Add(o.id, o);
			}
		}

		public void Update(float time) {
			foreach(KeyValuePair<char, GameObject> par in this)
				par.Value.Update(time);
		}
	}
}
